Random Background Sound

Below is the script. You can place it anywhere below the <body> tag in your HTML document.

Any text that you see in brackets "[ ]" has to be changed to the apropriate value. For instance, if one of the midi files you wan't to play is at "http://www.fortunecity.com/meltingpot/dalston/74/33.mid", then you would put that inside the brackets that say [URL OF SONG 1 HERE]. If you wan't more that 2 options, just add another line right below: var2="[URL OF SONG 2 HERE]"; that says exactly the same thing as the line above it only instead of "var2", use "var3" then "var4" and so on. DON"T FORGET! If you have 5 songs, put "5" in that place where it says: [TOTAL NUMBER OF SONGS HERE]. If you forget, it wont work at all.

You can see a demonstration of this script at my entrance page.

AND FOR GOD's SAKE: when you put your URL for your song in, or total number of songs, ERASE THE LITTLE "[" and "]" things!

****If You Can't Get the script to work, drop me a line at [email protected] and I'll see what I can do.****


<SCRIPT LANGUAGE="JavaScript">
<!-- ;
//This Script was written by Ben Reese
var1="[URL OF SONG 1 HERE]";
var2="[URL OF SONG 2 HERE]";
now=new Date()
num=(now.getSeconds() )%[TOTAL NUMBER OF SONGS HERE]
num=num+1
quot="'"
if (navigator.appName == "Microsoft Internet Explorer")
{ document.write("<bgsound src=" + quot + eval("var"+num) + quot + "loop='1'>")
}
if (navigator.appName != "Microsoft Internet Explorer")
{ document.write("<embed src=" + quot + eval("var"+num) + quot + "autostart='true' hidden='true' loop='1'>")
}
// end hide -->
</SCRIPT>